package io_wails

import (
	"clean/usecase/io/pb"
	"errors"
)

func (r *Handler) Hello(s string) (string, error) {
	in := &pb.Input{
		Msg: &pb.Input_InputHello{
			InputHello: &pb.InputHello{
				Name: s,
			},
		},
	}
	out := &pb.Output{}
	r.app.Hello(*in, out)
	if out.Error != nil {
		return "", errors.New(out.Error.Msg)
	}
	return out.GetOutputHello().Msg, nil
}
